<template>
    <div>
        <div class="welcome-container">
            <div class="welcome-message">
                <img :src="src">
                <h1>欢迎来到健景体检中心，一起守护健康</h1>
                <p>保持健康的生活方式，可以预防
                    70%-80%的疾病，是成本最低，回报最高的投资。
                </p>
                <p>
                    Maintaining a healthy lifestyle can be prevented70%-80% of diseases are the lowest-cost, highest-return investments.
                </p>
            </div>
        </div>
    </div>
</template>
<script>
export default {
    data(){
        return{
            src:"",
        }
    },
    mounted() {  
    // 组件挂载完成后从localStorage获取图片路径 
        const face = localStorage.getItem('patientFace');
        if(face!=null){
            this.src = face;
        }else{
            this.src = "https://cube.elemecdn.com/e/fd/0fc7d20532fdaf769a25683617711png.png"
        }
        
        
    },
    methods:{
        
    }
}
</script>
<style>
    body{
        height: 100%;
        margin: 0;
        font-family: Arial, sans-serif;
        
    }

    .welcome-container {
        display: flex;
        justify-content: center;
        align-items: center;
        height: 80vh;
        background-image: url("../../static/img/welCome.png"); 
        background-size: cover;
        background-position: center;
        color: white; /* 根据背景色调整文字颜色 */
        text-align: center;
    }

    .welcome-message {
        padding: 20px;
        background-color: rgba(0, 0, 0, 0.5); /* 半透明黑色背景，增强文字可读性 */
        border-radius: 10px;
    }

    .welcome-message img{
        width: 100px;
        height: 100px;
        border-radius: 50%;
    }
    h1 {
        margin: 0;
    }
    </style>